package com.three.iot.service.core;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.mail.SimpleMailMessage;

/**
 * @author luiz
 * @Title: EmailSendService
 * @ProjectName csuser
 * @Description: TODO
 * @date 2018-12-26 10:45
 */
//@Service
public class EmailSendService {
    private static final Logger logger = LoggerFactory.getLogger(EmailSendService.class);
    //@Autowired
    // private JavaMailSender mailSender;

    // @Value("${spring.mail.username:system}")
    private String emailFrom;


    /**
     * 发送邮件提醒
     *
     * @param recvEmail
     * @param title
     * @param sendContent
     */
    public void notifyEmail(String recvEmail, String title, String sendContent) {
        if (StringUtils.isEmpty(recvEmail)) {
            return;
        }
        SimpleMailMessage message = new SimpleMailMessage();
        message.setFrom(emailFrom);
        message.setTo(recvEmail);
        message.setSubject(title);
        message.setText(sendContent);
        //mailSender.send(message);
    }

}
